package com.may.consumer.service;

import com.may.consumer.api.ConsumerHelloServiceApi;
import com.may.provider.api.ProviderHelloServiceApi;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;

@Slf4j
@DubboService
public class ConsumerHelloService implements ConsumerHelloServiceApi {

    @DubboReference
    private ProviderHelloServiceApi providerHelloServiceApi;

    @Override
    public String hello(String msg) {
        log.info("consumer 接收到参数：[{}]",msg);
        return String.format("consumer message ：[%s]",msg);
    }

    @Override
    public String consumerHello(String msg) {
        log.info("consumer 接收到参数：[{}]",msg);
        return providerHelloServiceApi.hello(msg);
    }
}
